Magic-sets for localised analysis of Java bytecode
نویسندگان
چکیده
Static analyses based on denotational semantics can naturally model functional behaviours of the code in a compositional and completely context and flow sensitive way. But they only model the functional i.e., input/output behaviour of a program P , not enough if one needs P ’s internal behaviours i.e., from the input to some internal program points. This is, however, a frequent requirement for a useful static analysis. In this paper, we overcome this limitation, for the case of mono-threaded Java bytecode, with a technique used up to now for logic programs only. Namely, we define a program transformation that adds new magic blocks of code to the program P , whose functional behaviours are the internal behaviours of P . We prove the transformation correct w.r.t. an operational semantics and define an equivalent denotational semantics, devised for abstract interpretation, whose denotations for the magic blocks are hence the internal behaviours of P . We implement our transformation and instantiate it with abstract domains modelling sharing of two variables, non-cyclicity of variables, nullness of variables, class initialisation information and size of the values bound to program variables. We get a static analyser for full mono-threaded Java bytecode that is faster and scales better than another operational pair-sharing analyser. It has the same speed but is more precise than a constraint-based nullness analyser. It makes a polyhedral size analysis of Java bytecode scale up to 1300 methods in a couple of minutes and a zone-based size analysis scale to still larger applications.
منابع مشابه
Magic-Sets Transformation for the Analysis of Java Bytecode
Denotational static analysis of Java bytecode has a nice and clean compositional definition and an efficient implementation with binary decision diagrams. But it models only the functional i.e., input/output behaviour of a program P , not enough if one needs P ’s internal behaviours i.e., from the input to some internal program points. We overcome this limitation with a technique used up to now...
متن کاملThe Problem of Bytecode Verification in Current Implementations of the JVM
The main problems of Java Bytecode Verification are embedded subroutines and multiple inheritance via interfaces. The problem with interfaces has been solved (by using sets of reference types or by introducing a run-time check for the invokeinterface instruction). It is widely believed that also the problem with subroutines has been solved. This is not true. Most research has been focussed on s...
متن کاملTowards Verification of Java Bytecode using Logic Programming Tools
State of the art analyzers in the (Constraint) Logic Programming paradigm (or (C)LP for short) are nowadays mature and sophisticated. They allow inferring a wide variety of global properties including termination, run-time error freeness, bounds on resource consumption, etc. The aim of this work is to automatically transfer the power of such analysis tools for LP to the analysis and verificatio...
متن کاملComputing Stack Maps with Interfaces
Lightweight bytecode verification uses stack maps to annotate Java bytecode programs with type information in order to reduce the verification to type checking. This paper describes an improved bytecode analyser together with algorithms for optimizing the stack maps generated. The analyser is simplified in its treatment of base values (keeping only the necessary information to ensure memory saf...
متن کاملJSimil - A Java Bytecode Clone Detector
We present JSimil, a code clone detector that uses a novel algorithm to detect similarities in sets of Java programs at the bytecode level. The proposed technique emphasizes scalability and efficiency. It also supports customization through profiles that allow the user to specify matching rules, system behavior, pruning thresholds, and output details. Experimental results reveal that JSimil out...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید
ثبت ناماگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید
ورودعنوان ژورنال:
- Higher-Order and Symbolic Computation
دوره 23 شماره
صفحات -
تاریخ انتشار 2010